// .txt

beginzonescript;

variables;

short crime_tolerance = 5;
short last_abil;
short i;

body;

beginstate INIT_STATE;
	sf(10,8,0);
	sf(10,10,0);
	
	set_name(50,"Large Thahd");
	set_name(51,"Large Thahd");
	
	add_range_to_group(8,12,1);
	set_name(1001,"Mera-Tev Refugee");
	change_max_health(1001,40);
	set_name(8,"Modell");
	
	if (get_sdf(11,1) > 0) {
		make_zone_hostile();
		}

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	// clear zone?
	if ((zone_clear(ME) == FALSE) && (get_flag(10,1) > 0)) {
		print_str_color("Now that the brigand is gone, you can pass this area freely.",2);
		clear_zone(ME);	
		}
		
	if ((get_crime_level() >= crime_tolerance) && (get_sdf(11,1) == 0)) {
		make_zone_hostile();
		set_flag(11,1,1);
		}

	 if ((gf(11,1) == 0) && (gf(10,5) < 2)) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(8,"Welcome.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(8,"We are peaceful people.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(8,"We have nothing to rob.");
		}
	
	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	
	if ((char_ok(13)) && (gf(10,8) > 0)) {
		sf(10,8,0);
		print_str_color("Koski sees you slip down this path. He lets out an angry shout.",2);
		
		}
break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
